package org.makcro.sms.services.chat.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The persistent class for the QuestionResponsibility database table.
 * 
 */
@Entity
@Table(name = "questionresponsibility")
@NamedQueries({ @NamedQuery(name = "QuestionResponsibility.findByAgentAndQuestion", query = "SELECT qr FROM QuestionResponsibility qr WHERE qr.agent = :agent AND qr.question = :question"),
		@NamedQuery(name = "QuestionResponsibility.findByAgentAndQuestionId", query = "SELECT qr FROM QuestionResponsibility qr WHERE qr.agent = :agent AND qr.question.questionID = :questionId"),
		@NamedQuery(name = "QuestionResponsibility.findByQuestionId", query = "SELECT qr FROM QuestionResponsibility qr WHERE qr.question.questionID = :questionId"),
		@NamedQuery(name = "QuestionResponsibility.deleteByAgentAndQuestionId", query = "DELETE FROM QuestionResponsibility qr WHERE qr.question.questionID = :questionId AND qr.agent = :agent")

})
public class QuestionResponsibility implements Serializable {
	private static final long	serialVersionUID	= 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "QuestionResponsibilityID")
	private int					questionResponsibilityID;

	@Column(name = "Active")
	private boolean				active;

	// bi-directional many-to-one association to Agent
	@ManyToOne
	@JoinColumn(name = "AgentID")
	private Agent				agent;

	// bi-directional many-to-one association to Question
	@ManyToOne
	@JoinColumn(name = "QuestionID")
	private Question			question;

	public QuestionResponsibility() {
	}

	public int getQuestionResponsibilityID() {
		return this.questionResponsibilityID;
	}

	public void setQuestionResponsibilityID(int questionResponsibilityID) {
		this.questionResponsibilityID = questionResponsibilityID;
	}

	public boolean getActive() {
		return this.active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public Agent getAgent() {
		return this.agent;
	}

	public void setAgent(Agent agent) {
		this.agent = agent;
	}

	public Question getQuestion() {
		return this.question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}

}